package salve;

import java.net.ServerSocket;
import java.net.Socket;

public class SlaveServer implements Runnable{

	private ServerSocket server;
	
	public SlaveServer() {
		try {
			server = new ServerSocket(9999);
			new Thread(this).start();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	@Override
	public void run() {
		while (true){
			try {
				Socket socket = server.accept();
				System.out.println(socket.getInetAddress());
				new SlaveClient(socket);				
			} catch (Exception e) {
			}
		}
	}

}
